package database.util;

import java.util.LinkedList;

import javax.swing.JFrame;
import javax.swing.table.AbstractTableModel;

import database.domain.DatoTabla;
import database.domain.Equipo;

public class ModeloTablaPersonajes extends AbstractTableModel{
	private LinkedList<DatoTabla> datos= new LinkedList<DatoTabla>();
	private final String [] nombreColumnas= { "Pic", "Name", "Cost", "Habi.", "Cost SP", "Attack", "Def",
			"Magi", "Res", "Speed", "Jump", "SP", "HP"};
	public ModeloTablaPersonajes(){ }

	public String getColumnName(int col){
		return nombreColumnas[col];
	}
	public int getColumnCount() {
		return nombreColumnas.length;
	}
	public int getRowCount() {
		return datos.size();
	}
	public Object getValueAt(int fila, int col) {
		Object o= datos.get(fila).getDato(col);
		if(o==null) return new String(" ");
		else return o;
	}


	public Class getColumnClass(int col){
		if(datos.size()==0) return String.class;
		else{
			if(col==5) return String.class;
			else return getValueAt(0, col).getClass();
		}
	}
	public void insert(DatoTabla dato){
		datos.add(dato);
	}
	public static void main (String [] argrs){
		JFrame ventanita= new JFrame();

	}

}
